﻿@model Entity.Dto.UserRoleDto
@{
    Layout = "~/Views/Shared/_Style.cshtml";
}
@*layer*@
<link href="~/js/lib/layui/dist/css/layui.css" rel="stylesheet" />
<script src="~/js/lib/jquery/jquery-3.2.1.js"></script>
<script src="~/js/lib/layui/dist/layui.js"></script>
<script src="~/js/content/user/roleUser.js"></script>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>角色设定表单</legend>
</fieldset>

<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">角色下拉框</label>
        <div class="layui-input-block">
            @if (Model.RoleUserId == 1)
            {
                <select name="city" id="RoleId" lay-verify="required">
                    <option value=""></option>
                    @foreach (var item in Model.RoleList)
                    {
                        if (item.RoleId == Model.RoleId)
                        {
                            <option value="@item.RoleId" selected="selected">@item.RoleName</option>
                        }
                        else
                        {
                            <option value="@item.RoleId">@item.RoleName</option>
                        }

                    }
                </select>
            }
            else
            {
                <select name="city" id="RoleId" lay-verify="required" disabled="disabled">
                    <option value=""></option>
                    @foreach (var item in Model.RoleList)
                    {
                        if (item.RoleId == Model.RoleId)
                        {
                            <option value="@item.RoleId" selected="selected">@item.RoleName</option>
                        }
                        else
                        {
                            <option value="@item.RoleId">@item.RoleName</option>
                        }
                    }
                </select>
            }

        </div>
    </div>
    <div class="layui-form-item" style="margin:0  0 0 40% ">
        <div class="layui-input-block">
            <br />
            <button class="layui-btn" lay-submit="" lay-filter="submit">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
    <input id="UserId" type="hidden" value="@Model.UserId" />
    <input id="UserRoleId" type="hidden" value="@Model.UserRoleId" />
</form>
